import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useContextMenuStore = defineStore(
    'contextMenu',
    () => {
        const appContextMenuShown = ref(false)
        const musicContextMenuShown = ref(false)
        const pageX = ref(0)
        const pageY = ref(0)

        const closeAll = ()=>{
            appContextMenuShown.value = false
            musicContextMenuShown.value = false
        }
        const showAppContext = (X: number, Y: number) => {
            pageX.value = X
            pageY.value = Y
            appContextMenuShown.value = true
        }
        return {
            appContextMenuShown,
            musicContextMenuShown,
            closeAll,
            showAppContext,
            pageX,
            pageY
        }
    },
    {
        persist: false
    }
)
